package org.fhm.zdte.common.pojo;


import org.fhm.zdte.common.annotation.InternalProvider;
import org.fhm.zdte.common.annotation.Provider;
import org.fhm.zdte.common.annotation.RequestMapping;

import java.lang.reflect.Method;

/**
 * One interface corresponds to one servlet.
 *
 * @author 谭波
 * @since 2023/11/29
 */
public final class Servlet {

    /**
     * Bean objects that are injected into the IOC by {@link Provider} and {@link InternalProvider} tags.
     */
    private final Object bean;

    /**
     * The method that is marked by {@link RequestMapping} in the {@link Servlet#bean}.
     */
    private final Method method;

    public Servlet(Object bean, Method method) {
        this.bean = bean;
        this.method = method;
    }

    public Object getBean() {
        return bean;
    }

    public Method getMethod() {
        return method;
    }
}